package service.impl;

import Dao.MusicMngDao;
import Dao.impl.MusicMngDaoImpl;
import pojo.Songs;
import service.MusicMngService;

import java.util.List;


/**
 * 作者：杨晋
 */
public class MusicMngServiceImpl implements MusicMngService {
    MusicMngDao MusicMngDao = new MusicMngDaoImpl();

    @Override
    public List<Songs> selectMusicList(int startIndex, int targetTotal) {
        return MusicMngDao.getSongList(startIndex, targetTotal);
    }

    @Override
    public Integer getTotalSongCount() {
        List<Songs> users = MusicMngDao.selectSongList();
        return users.size();
    }

    @Override
    public List<Songs> selectSongListByName(String songName) {
        return MusicMngDao.selectUserListByName(songName);
    }

    @Override
    public Songs getSongById(int songId) {
        return MusicMngDao.getSongById(songId);
    }

    @Override
    public boolean updateSong(Songs songs) {
        return MusicMngDao.updateSong(songs);
    }

    @Override
    public boolean deleteUploadedSong(int songId) {
        return MusicMngDao.deleteUploadedSong(songId);
    }
}